<template>
   <ul class="timeline" :class="directions">
      <li>
        <i :data-mark="mark[0]" class="bg-orange active" :class="{activeIndex:'active'}"></i>
        <p><slot name="slot0"></slot></p>
      </li>
      <li>
        <i :data-mark="mark[1]" class="bg-default"></i>
        <p><slot name="slot1"></slot></p>
      </li>
      <li>
        <i :data-mark="mark[2]" class="bg-default"></i>
        <p><slot name="slot2"></slot></p>
      </li>
    </ul> 
</template>
// 方向
<script>
export default {

  props: {
    // 方向
    directions:{
      type:String,
      default:'',
    },
    mark:{
      type:Array,
      default:()=>['1992-8-15','2020-8-7','455-888']
    },
    activeIndex:{
      type:Number,
      default:1
    }
  }
}
</script>

<style scoped >
ol,ul {
	list-style: none;
  margin: 0;
  padding: 0;
}

ul.timeline>li>i[data-mark],.btn,.badge,[data-tooltip]:after {
	text-decoration: none;
	text-indent: 0;
	text-transform: none;
	text-shadow: none;
	word-spacing: normal;
	letter-spacing: normal;
	font-weight: normal;
	font-style: normal;
	text-rendering: auto;
}

.bg-orange {
	background-color: #ff6a13 !important;
}
.bg-default {
  background-color: #c523 !important;
}

@keyframes mark-active {
	from {
		opacity: .75;
	}

	to {
		opacity: 0;
		transform: scale(2);
		-webkit-transform: scale(2);
	}
}
/*--timeline--*/
ul.timeline {
	position: relative;
	display: flex;
	flex-direction: column;
	margin-bottom: 1.5rem;
}

ul.timeline:before {
	position: absolute;
	top: 0;
	left: 2.625rem;
	display: block;
	width: .75rem;
	height: 100%;
	border-radius: .375rem;
	background-color: #f2f2f2;
	content: "";
}

ul.timeline>li {
	position: relative;
	margin: 0 0 1.5rem 6rem;
	padding: 1.5rem;
	width: calc(100% - 6rem);
	border-radius: .375rem;
	background-color: #fff;
	box-shadow: .1rem .1rem 1rem rgba(0,0,0,.2);
	color: #333;
}

ul.timeline>li:last-of-type {
	margin-bottom: 0;
}

ul.timeline>li:before {
	position: absolute;
	top: calc(50% - .5rem);
	left: -.5rem;
	width: 1rem;
	height: 1rem;
	background-color: inherit;
	content: "";
	transform: rotate(45deg);
	-webkit-transform: rotate(45deg);
}

ul.timeline>li>i[data-mark] {
	position: absolute;
	top: calc(50% - .75rem);
	left: -3.75rem;
	width: 1.5rem;
	height: 1.5rem;
	border-radius: 50%;
	background-color: #333;
	box-shadow: .1rem .1rem .5rem rgba(0,0,0,.15);
}

ul.timeline>li>i[data-mark]:after {
	display: inline-block;
	overflow: hidden;
	margin-top: 2rem;
	margin-left: -1.75rem;
	width: 5rem;
	max-height: 2.75rem;
	color: #333;
	content: attr(data-mark);
	text-align: center;
	word-wrap: break-word;
	font-size: .925rem;
	line-height: 1.5;
}

ul.timeline>li>i[data-mark].active:before {
	position: absolute;
	top: 0;
	left: 0;
	display: inline-block;
	width: 100%;
	height: 100%;
	border-radius: 50%;
	background-color: inherit;
	content: "";
	animation: mark-active 1.5s ease-in-out infinite;
	-webkit-animation: mark-active 1.5s ease-in-out infinite;
}

ul.timeline.right>li {
	margin: 0 6rem 1.5rem 0;
}

ul.timeline.right>li:last-of-type {
	margin-bottom: 0;
}

ul.timeline.right>li:before {
	left: auto;
	right: -.5rem;
}

ul.timeline.right>li>i[data-mark] {
	left: auto;
	right: -3.75rem;
}

ul.timeline.right:before {
	left: auto;
	right: 2.625rem;
}

</style>
